package com.darrenchan.course08

/**
  * 所有的隐式值和隐式方法必须放到object里面
  */
object Context {
  implicit val s = "陈二珂"
  implicit val a = 1
}


object ImplicitValueApp {

  def sayHi()(implicit name: String = "陈驰"): Unit ={
    println(s"Hi ${name}" + name)
  }

  def main(args: Array[String]): Unit = {
    import Context._
//    sayHi() //引入import Context._以后，这里打印的是陈二珂，之前打印的是默认值陈驰
    sayHi()("123") //当我传入柯里化函数参数，又会打印123
  }
}
